﻿@page "/RadzenDialogTest"

<RadzenButton Text="OpenDialog" ButtonStyle="Radzen.ButtonStyle.Primary" Click=@OpenDialog />
@code {

    [CascadingParameter] private Radzen.Dialog _dialog { get; set; }
    [Inject] private Radzen.DialogService _dialogService { get; set; }

    private async Task OpenDialog()
    {
        var result = await _dialogService.OpenAsync<CounterDialog>("计数器",
            new Dictionary<string, object>() { { "Counter", 10 } }, // 传递初始值
            new DialogOptions() { Width = "500px" });
        // 处理返回结果
        if (result != null)
        {
            // 处理返回的数据
        }
    }
}
